POV-Ray : Newsgroups : povray.advanced-users : vector.x is a float, isn't it? : vector.x is a float, isn't it? Server Time
3 Jul 2024 05:05:11 EDT (-0400)
  vector.x is a float, isn't it?  
From: slehar
Date: 13 Jul 2008 17:35:00
Message: <web.487a73ecc7f877ecf75a90cb0@news.povray.org>
Can someone please explain to me why I ***can't*** do this?

CODE >>>>
  #declare myVector = <1,2>

  atan2(myVector.y,myVector.x)
<<<< CODE

Parse Error: Expected 'operand', uv vector identifier found instead

But why I ***CAN*** do this?

CODE >>>>
  #declare myVector = <1,2>;
  #declare xValue = myVector.x;
  #declare yValue = myVector.y;

  atan2(yValue,xValue)
<<<< CODE

Works just fine!

Isn't myVector.x a plain float value that can be used wherever
a float is required?

  slehar


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.